package com.quanyan.place.service;

import com.quanyan.api.APIResponse;
import com.quanyan.common.Plugin.PageObj;
import com.quanyan.common.enums.BaseEnum;
import com.quanyan.place.entity.TbBizPlace;
import com.quanyan.place.entity.TbBizPlaceAttach;
import com.quanyan.place.entity.TbBizPlaceCategory;
import com.quanyan.place.entity.TbBizPlaceUnit;
import com.quanyan.place.entity.apiresp.RespCategoryAndScale;
import com.quanyan.place.entity.apiresp.RespPlaceInfo;
import com.quanyan.place.entity.vo.PlaceCategoryVo;

import java.util.List;
import java.util.Set;

/**
 * Created by yangyun on 16-6-6.
 */
public interface PlaceBaseService {

    /**
     * 根据场馆Id获取场地列表
     * @param placeId
     * @param categoryId
     * @param isSign
     * @return
     */
    List<TbBizPlaceUnit> getPlaceUnitByPlaceId(Integer placeId, Byte categoryId, boolean isSign);

    // 比getPlaceUnitByPlaceId 多返回有效的组合场信息
    public List<TbBizPlaceUnit> getPlaceUnitByPlaceIdEx(Integer placeId, Byte categoryId, boolean isSign);

    PageObj<List<TbBizPlace>> getPlaceByLikeName(String placeName, Integer isDelete);


    /**
     * 根据场馆ID获取场馆附属信息
     * @param placeId
     * @return
     */
    TbBizPlaceAttach getBizPlaceAttach(Integer placeId);

    List<TbBizPlaceAttach> getBizPlaceAttachList(String vipShareNo);

    /**
     * 根据场馆ID获取场馆信息表数据
     * @param placeId
     * @return
     */
    TbBizPlace getPlaceById(Integer placeId);

    /**
     * 根据场馆Id获取经营范围（场馆经营的运动项目列表）
     * @param placeId
     * @return
     */
    List<TbBizPlaceCategory> getPlaceCategoryList(Integer placeId);

    APIResponse getCategory();

    APIResponse selectPlaceByName(String placeName);

    TbBizPlace getPlaceByEqualName(String placeName, Integer isDelete);

    /**
     * 生成场馆编号
     * @param cityCode
     * @param categoryIdSet
     * @return
     */
    String generatePlaceCode(String cityCode, Integer placeId, Set<Integer> categoryIdSet);

    void updatePlaceBySelective(TbBizPlace tbBizPlace);

    void updatePlaceUnitBySelective(TbBizPlaceUnit tbBizPlaceUnit);

    void updatePlaceUnitByPrimaryKey(TbBizPlaceUnit tbBizPlaceUnit);

    void updatePlaceAttachBySelective(TbBizPlaceAttach tbBizPlaceAttach);

    boolean updateByPrimaryKeySelective(TbBizPlace tbBizPlace);

    void deletePlaceCategory(Integer id);

    void insertPlaceCategory(TbBizPlaceCategory tbBizPlaceCategory);

    boolean isExistsPlace(Integer placeId);

    /**
     * 获取场馆运动项目及场地规模
     * @param placeId
     * @return
     */
    List<RespCategoryAndScale> getCategoryAndScale(Integer placeId, boolean isFilterNotPriced);

    boolean isAnyOrder(Integer uid);

    /**
     * 获得联营场馆
     * @return
     */
    List<TbBizPlace> getPoolPlace(Byte businessMode,Integer isDelete,Integer isShelves);

    /**
     * 保存更新打印机设置
     * @param placeId
     * @param printNum
     * @param printMemo
     * @return
     */
    APIResponse<?> saveOrUpdatePrintSetting(Integer placeId,Integer printNum,String printMemo);

    /**
     * 根据场馆id获取打印机设置
     * @param placeId
     * @return
     */
    APIResponse<?> getPrintSettingByPlaceId(Integer placeId);
    
    /**
     * 设置场馆运动项目最小销售单元
     * @param placeId
     * @param categoryId
     * @param timeUnit
     * @param startSaleTimeType
     */
    boolean setPlaceCategorySaleTimeUnit(Integer placeId, Integer categoryId, Byte timeUnit, Byte startSaleTimeType);

    List<TbBizPlaceCategory> getPlaceCategorySaleTimeUnit(Integer placeId);

    List<TbBizPlaceAttach> getSharePlaceVipByShareNo(String vipShareNo);

    /**
     * 查询指定场馆互通会员的场馆列表
     * @param placeId
     * @param vipShareNo
     * @return
     */
    List<RespPlaceInfo> getSharePlace(Integer placeId, String vipShareNo);

    /**
     * 根据场馆Id、栏目id查询场馆项目配置
     * @param placeId
     * @param categoryId
     * @return
     */
    TbBizPlaceCategory getPlaceCategory(Integer placeId, Integer categoryId);

    /**
     * 指定场馆、栏目是否已定价
     * @param placeId
     * @param categoryId
     * @return
     */
    boolean isAnyPrice(Integer placeId, Integer categoryId);

    /**
     * 发送Email给管理员
     * @param subject
     * @param content
     */
    void sendTextEmails(String subject, String content);
}
